home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / ABox 1.9.5 / Header Files / ABOtherTopic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-26  |  4.7 KB  |  169 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABOtherTopic.h
  15.  
  16. NAME
  17.     ABOtherTopic.h, part of the ABox project source code,
  18.     responsible for handling the ABOtherTopic class stuff.
  19.  
  20. DESCRIPTION
  21.     This file contains defines for the about box modules.
  22.     
  23. DEVELOPED BY
  24.     George (ty) Tempel                ttempel@monmouth.com
  25.     All code in this file, and its associated header file was
  26.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  27.     "FilterTop" application development, except where noted.
  28.  
  29. CARETAKER - George (ty) Tempel <ttempel@monmouth.com>
  30.      Please consult this person for any changes or suggestions to this file.
  31.  
  32. MODIFICATION HISTORY
  33.  
  34.     dd mmm yy    -    xxx    -    patchxx: description of patch
  35.     13-july-94    -    ty    -    Initial Version Created
  36.     20-july-94    -    ty    -    initial version released
  37.     10-apr-95    -    ty    -    added support for TeachText/SimpleText 'ttro'
  38.                             documents (but only as text, no pict processing)
  39.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  40.                             release and the associated Universal Headers from Apple:
  41.                             most methods that returned references now have "Ref" at
  42.                             the end of their methods names to prevent possible collisions
  43.                             with datatypes and classes of the same name (older versions
  44.                             of the compiler didn't have a problem with this).
  45.     25-oct-95    -    ty    -    changes for "const" usage under CW7; simplification of Boolean
  46.                             query methods
  47. */
  48.  
  49. /*===========================================================================*/
  50.  
  51. /*========== Exclusion Macros ============*/
  52.  
  53. #pragma    once
  54.  
  55. #ifndef    _ABOtherTopic_
  56. #define    _ABOtherTopic_
  57.  
  58.  
  59. /*============ Header Files ==============*/
  60.  
  61. //#include    "ABLinkedList.h"
  62. #include    "ABTopicList.h"
  63. #include    "ABTopic.h"
  64. #include    "ABPict.h"
  65. #include    "ABText.h"
  66.  
  67.  
  68. /*=========== External Linkage ===========*/
  69.  
  70. /*================ Macros ================*/
  71.  
  72. /*============== Constants ===============*/
  73.  
  74. //    this is a RESERVED dummy resource ID, used to synthesize
  75. //    resources for the ABox things...
  76. #define        kABSyntheticResourceID        5100
  77. #define        kABSyntheticResourceName    "\pSynthetic ABox Resource"
  78.  
  79.  
  80.  
  81. //    These are Properties that the caller can play with:
  82. #define        kABbadFileType                '????'
  83. #define        kABFolderFileType            'fldr'
  84. #define        kABTeachTextReadOnly        'ttro'
  85.  
  86. #define        kABTopicFileType            'Tfty'
  87. typedef        OSType                        ABTopicFileType;
  88. #define        kABTopicFileTypeSize        (sizeof(ABTopicFileType))
  89.  
  90. #define        kABTopicIsFolder            'TisF'
  91. #define        kABTopicIsFolderSize        (sizeof(Boolean))
  92.  
  93. /*================ Enums =================*/
  94.  
  95. /*=============== Structs ================*/
  96.  
  97. /*=============== Typedefs ===============*/
  98.  
  99. /*=========== Class Definitions ==========*/
  100.  
  101. #define    kABOtherTopicSuperProperties    ABTopic
  102. class    ABOtherTopic : public ABTopic
  103. {
  104.     friend class ABTopicList;
  105.     
  106.     public:
  107.                                 ABOtherTopic(const FSSpec& inTopicFSSpec);
  108.         virtual                    ~ABOtherTopic(void);
  109.  
  110.         virtual    OSErr            GetProperty (ABProperty prop, 
  111.                                             void *ptr, 
  112.                                             long *ptrSize);
  113.         virtual    OSErr            SetProperty (ABProperty prop, 
  114.                                             void *ptr, 
  115.                                             long ptrSize);
  116.         
  117.         virtual    OSErr            Draw(WindowPtr window);
  118.         virtual    OSErr            Update(WindowPtr window);
  119.         virtual    Boolean            Event(EventRecord *event);
  120.         virtual    OSErr            Stop(void);
  121.         
  122.         virtual    OSErr            Resize (Rect const *field);
  123.  
  124.                 Boolean            HasBlurb(void) const { return this->BlurbRef() != NULL; }
  125.                 Boolean            DoesntHaveBlurb(void) const { return ! this->HasBlurb(); }
  126.                 
  127.                 OSType            GetFileType(void) const { return this->FileTypeRef(); }
  128.                 
  129.                 Boolean            IsFolder(void) const { return this->GetFileType() == kABFolderFileType; }
  130.                 
  131.                 Boolean            IsPicture(void) const { return this->GetFileType() == kABPictResource; }
  132.                 
  133.                 Boolean            IsText(void) const { return this->GetFileType() == kABTextResource; }
  134.                 
  135.                 Boolean            IsTeachTextReadOnly(void) const { return this->GetFileType() == kABTeachTextReadOnly; }
  136.                 Boolean            IsSimpleTextReadOnly(void) const { return this->IsTeachTextReadOnly(); }
  137.                 
  138.     protected:
  139.         virtual    OSErr            DoLoad (void);
  140.         virtual    OSErr            DoCheckSlides (void);
  141.  
  142.         virtual    OSErr            OpenTopic (void);
  143.         virtual    OSErr            CloseTopic (void);
  144.         
  145.     private:
  146.                 ABResource*        mBlurb;
  147.                 OSType            mFileType;
  148.                 
  149.                 ABResource*&        BlurbRef(void)      { return this->mBlurb; }
  150.                 ABResource* const&    BlurbRef(void) const { return this->mBlurb; }
  151.                 
  152.                 OSType&                FileTypeRef(void)      { return this->mFileType; }
  153.                 OSType const&        FileTypeRef(void) const { return this->mFileType; }
  154.  
  155. };
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. /*========== Function Prototypes =========*/
  163.  
  164.  
  165.  
  166.  
  167. #endif    // _ABOtherTopic_
  168.  
  169.